home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / td.h,v < prev    next >
Encoding:
Text File  |  1990-09-11  |  6.9 KB  |  311 lines

  1. head     1.7;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.7
  10. date     90.09.11.14.39.48;  author kupfer;  state Exp;
  11. branches ;
  12. next     1.6;
  13.  
  14. 1.6
  15. date     90.09.04.20.46.23;  author rab;  state Exp;
  16. branches ;
  17. next     1.5;
  18.  
  19. 1.5
  20. date     89.07.31.19.01.38;  author ouster;  state Exp;
  21. branches ;
  22. next     1.4;
  23.  
  24. 1.4
  25. date     89.06.03.16.47.53;  author ouster;  state Exp;
  26. branches ;
  27. next     1.3;
  28.  
  29. 1.3
  30. date     89.06.03.14.38.20;  author ouster;  state Exp;
  31. branches ;
  32. next     1.2;
  33.  
  34. 1.2
  35. date     89.04.06.09.33.42;  author ouster;  state Exp;
  36. branches ;
  37. next     1.1;
  38.  
  39. 1.1
  40. date     88.06.29.09.51.36;  author ouster;  state Exp;
  41. branches ;
  42. next     ;
  43.  
  44.  
  45. desc
  46. @@
  47.  
  48.  
  49. 1.7
  50. log
  51. @Clean up function prototypes some.
  52. @
  53. text
  54. @/*
  55.  * td.h --
  56.  *
  57.  *    Declarations of externally-visible things provided by the
  58.  *    terminal driver library.  This includes both the basic tty
  59.  *    driver and an interface between it and a pseudo-device.
  60.  *
  61.  * Copyright 1987, 1989 Regents of the University of California
  62.  * Permission to use, copy, modify, and distribute this
  63.  * software and its documentation for any purpose and without
  64.  * fee is hereby granted, provided that the above copyright
  65.  * notice appear in all copies.  The University of California
  66.  * makes no representations about the suitability of this
  67.  * software for any purpose.  It is provided "as is" without
  68.  * express or implied warranty.
  69.  *
  70.  * $Header: /sprite/src/lib/include/RCS/td.h,v 1.6 90/09/04 20:46:23 rab Exp Locker: kupfer $ SPRITE (Berkeley)
  71.  */
  72.  
  73. #ifndef _TD
  74. #define _TD
  75.  
  76. #include <sprite.h>
  77. #include <fmt.h>
  78.  
  79. typedef struct Td_Terminal *Td_Terminal;
  80. typedef struct Td_Pdev *Td_Pdev;
  81.  
  82. /*
  83.  * Command arguments to Td_ControlRaw:
  84.  */
  85.  
  86. #define TD_BREAK        1
  87. #define TD_GOT_CARRIER        2
  88. #define TD_LOST_CARRIER        3
  89.  
  90. /*
  91.  * Command arguments to the device's raw control procedure:
  92.  */
  93.  
  94. #define TD_RAW_START_BREAK    1
  95. #define TD_RAW_STOP_BREAK    2
  96. #define TD_RAW_SET_DTR        3
  97. #define TD_RAW_CLEAR_DTR    4
  98. #define TD_RAW_SHUTDOWN        5
  99. #define TD_RAW_OUTPUT_READY    6
  100. #define TD_RAW_FLUSH_OUTPUT    7
  101. #define TD_RAW_FLOW_CHARS    8
  102. #define TD_RAW_SET_BAUD_RATE    9
  103. #define TD_RAW_GET_BAUD_RATE    10
  104.  
  105. /*
  106.  * Data structure passed from the terminal driver to the raw
  107.  * control procedure for TD_RAW_FLOW_CHARS:
  108.  */
  109.  
  110. typedef struct {
  111.     char stop;            /* Character to stop output to raw
  112.                  * terminal;  -1 means no stop character. */
  113.     char start;            /* Character to restart output to raw
  114.                  * terminal;  -1 means no start character. */
  115. } Td_FlowChars;
  116.  
  117. /*
  118.  * Data structure passed from the terminal driver to the raw
  119.  * control procedure for TD_RAW_SET_BAUD_RATE and TD_RAW_GET_BAUD_RATE:
  120.  */
  121.  
  122. typedef struct {
  123.     char ispeed;        /* New input baud rate for terminal
  124.                  * (B9600, etc.). */
  125.     char ospeed;        /* New output baud rate for terminal
  126.                  * (B9600, etc.). */
  127. } Td_BaudRate;
  128.  
  129. /*
  130.  * Command arguments for the cooked control procedure:
  131.  */
  132.  
  133. #define TD_COOKED_SIGNAL    21
  134. #define TD_COOKED_READS_OK    22
  135. #define TD_COOKED_WRITES_OK    23
  136.  
  137. /*
  138.  * Data structure passed from the terminal driver to the cooked
  139.  * control procedure for TD_COOKED_SIGNAL:
  140.  */
  141.  
  142. typedef struct {
  143.     int sigNum;            /* Signal number to generate. */
  144.     int groupID;        /* ID of controlling process group
  145.                  * for terminal. */
  146. } Td_Signal;
  147.  
  148. /*
  149.  * Exported procedures:
  150.  */
  151.  
  152. extern Td_Terminal 
  153.     Td_Create _ARGS_((int bufferSize,
  154.               int (*cookedProc)_ARGS_((ClientData, int operation,
  155.                            int inBufSize, char *inBuffer,
  156.                            int outBufSize,
  157.                            char *outBuffer)),
  158.               ClientData cookedData,
  159.               int (*rawProc)_ARGS_((ClientData, int operation,
  160.                         int inBufSize, char *inBuffer,
  161.                         int outBufSize, char *outBuffer)),
  162.               ClientData rawData));
  163. extern void Td_Delete _ARGS_((Td_Terminal terminal));
  164. extern int Td_Open _ARGS_((Td_Terminal terminal, int *selectBitsPtr));
  165. extern void Td_Close _ARGS_((Td_Terminal terminal));
  166. extern int Td_GetCooked _ARGS_((Td_Terminal terminal, int pID, int familyID,
  167.     int *numCharsPtr, char *buffer, int *sigNumPtr, int *selectBitsPtr));
  168. extern int Td_PutCooked _ARGS_((Td_Terminal terminal, int *numBytesPtr,
  169.     register char *buffer, int *sigNumPtr, int *selectBitsPtr));
  170. extern int Td_ControlCooked _ARGS_((Td_Terminal terminal, int command,
  171.     Fmt_Format format, int inputSize, char *input, int *outputSizePtr,
  172.     char *output, int *sigNumPtr, int *selectBitsPtr));
  173. extern int Td_GetRaw _ARGS_((Td_Terminal terminal, int numChars,
  174.     register char *buffer));
  175. extern void Td_PutRaw _ARGS_((Td_Terminal terminal,
  176.     int numChars, char *buffer));
  177. extern void Td_ControlRaw _ARGS_((Td_Terminal terminal, int operation));
  178.  
  179. extern Td_Pdev Td_CreatePdev _ARGS_((char *name, char **realNamePtr,
  180.     Td_Terminal *termPtr, int (*rawProc)(), ClientData clientData));
  181. extern void Td_DeletePdev _ARGS_((Td_Pdev ttyPdev));
  182.  
  183. #endif /* _TD */
  184. @
  185.  
  186.  
  187. 1.6
  188. log
  189. @Added prototypes.
  190. @
  191. text
  192. @d17 1
  193. a17 1
  194.  * $Header: /sprite/src/lib/include/RCS/td.h,v 1.5 89/07/31 19:01:38 ouster Exp Locker: rab $ SPRITE (Berkeley)
  195. d99 11
  196. a109 2
  197. extern Td_Terminal Td_Create _ARGS_((int bufferSize, int (*cookedProc)(),
  198.     ClientData cookedData, int (*rawProc)(), ClientData rawData));
  199. @
  200.  
  201.  
  202. 1.5
  203. log
  204. @Changed TD_RAW_BAUD_RATE to TD_RAW_SET and _GET_BAUD_RATE.
  205. @
  206. text
  207. @d17 1
  208. a17 1
  209.  * $Header: /sprite/src/lib/include/RCS/td.h,v 1.4 89/06/03 16:47:53 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  210. d23 3
  211. d99 21
  212. a119 12
  213. extern int        Td_CheckOpen();
  214. extern void        Td_Close();
  215. extern Td_Terminal    Td_Create();
  216. extern Td_Pdev        Td_CreatePdev();
  217. extern void        Td_Delete();
  218. extern void        Td_DeletePdev();
  219. extern int        Td_ControlCooked();
  220. extern void        Td_ControlRaw();
  221. extern int        Td_GetCooked();
  222. extern int        Td_GetRaw();
  223. extern int        Td_PutCooked();
  224. extern void        Td_PutRaw();
  225. d121 1
  226. a121 1
  227. #endif _TD
  228. @
  229.  
  230.  
  231. 1.4
  232. log
  233. @Several changes:  TD_HANGUP is now TD_GOT_CARRIER and TD_LOST_CARRIER,
  234. added TD_RAW_BAUD_RATE callback, changed TD_COOKED_SIGNAL to provide
  235. both signal number and controlling process group.
  236. @
  237. text
  238. @d17 1
  239. a17 1
  240.  * $Header: /sprite/src/lib/include/RCS/td.h,v 1.3 89/06/03 14:38:20 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  241. d46 2
  242. a47 1
  243. #define TD_RAW_BAUD_RATE    9
  244. d63 1
  245. a63 1
  246.  * control procedure for TD_RAW_BAUD_RATE:
  247. @
  248.  
  249.  
  250. 1.3
  251. log
  252. @Document args to Td_ControlRaw.
  253. @
  254. text
  255. @d17 1
  256. a17 1
  257.  * $Header: /sprite/src/lib/include/RCS/td.h,v 1.2 89/04/06 09:33:42 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  258. d42 1
  259. a42 1
  260. #define TD_RAW_HANGUP        5
  261. d46 1
  262. d61 12
  263. d79 11
  264. @
  265.  
  266.  
  267. 1.2
  268. log
  269. @Major changes for new, more modular terminal emulator.
  270. @
  271. text
  272. @d17 1
  273. a17 1
  274.  * $Header: /a/newcmds/tty/RCS/td.h,v 1.1 89/01/21 17:10:31 ouster Exp $ SPRITE (Berkeley)
  275. d27 9
  276. a35 1
  277.  * Command arguments to the raw control procedure:
  278. @
  279.  
  280.  
  281. 1.1
  282. log
  283. @Initial revision
  284. @
  285. text
  286. @d5 2
  287. a6 1
  288.  *    terminal driver library.
  289. d8 1
  290. a8 1
  291.  * Copyright 1987 Regents of the University of California
  292. d17 1
  293. a17 1
  294.  * $Header: td.h,v 2.0 87/08/11 09:32:54 brent Exp $ SPRITE (Berkeley)
  295. d24 1
  296. d27 1
  297. a27 1
  298.  * Exported variables:
  299. d30 8
  300. a37 1
  301. extern char td_ErrorMsg[];
  302. d40 20
  303. d63 1
  304. d65 10
  305. a74 4
  306. extern void        Td_GetState();
  307. extern void        Td_InputChar();
  308. extern Td_Terminal    Td_Open();
  309. extern void        Td_SetState();
  310. @
  311.